# import random
# import time
# class Role1():
#     def __init__(self,name,sex,blood=100):
#         self.name = name
#         self.sex = sex
#         self.blood = blood
#         self.damage = 10
#         self.damage2 = 5
#     #普通伤害
#     def attack_role2(self,role2):
#         ran_num = random.randint(1,3)
#         if ran_num == 2:
#             print("玩家{}获得了防弹衣".format(role2.name))
#             role2.blood -= self.damage2
#             print("玩家:%s 攻击玩家:%s 伤害值:%d 玩家%s剩余生命值:%d"
#                   % (self.name, role2.name, self.damage2,role2.name, role2.blood))
#         else:
#             role2.blood -= self.damage
#             print("玩家:%s 攻击玩家:%s 伤害值:%d 玩家%s剩余生命值:%d"
#                   % (self.name, role2.name, self.damage, role2.name,role2.blood))
#
#     # def fangdanyi_role2(self,role2):
#     #     ran_num = random.randint(1,2)
#     #     if ran_num == 2:
#     #         print("玩家{}获得了防弹衣".format(role2.name))
#     #         role2.blood -= 5
#
#
# class Role2():
#     def __init__(self, name,sex, blood = 100):
#         self.name = name
#         self.sex = sex
#         self.blood = blood
#         self.damage = 10
#         self.damage2 = 5
#
#     def attack_role1(self, role1):
#
#         ran_num = random.randint(1,3)
#         if ran_num == 1:
#             print("玩家{}获得了防弹衣".format(role1.name))
#             role1.blood -= self.damage2
#             print("玩家:%s 攻击玩家:%s 伤害值:%d 玩家%s剩余生命值:%d"
#                   % (self.name, role1.name, self.damage2, role1.name,role1.blood))
#         else:
#             role1.blood -= self.damage
#             print("玩家:%s 攻击玩家:%s 伤害值:%d 玩家%s剩余生命值:%d"
#                   % (self.name, role1.name, self.damage,role1.name, role1.blood))
#
# class Room(object):
# #	MAX = 2
# 	def __init__(self):
# 		self.member_list = []
# 	def add_member(self,role):
# 		if len(self.member_list) < 2:
# 			self.member_list.append(role)
# 			#role.room = self
# 			print(f"{role.name}成功加入了房间")
# 		# elif len(self.member_list) == 2:
# 		# 	print("房间人数已满,开始战斗")
#
# count = 1
# #创建玩家
# charactor1 = Role1('谷帅',"男")
# charactor2 = Role2('金之扬',"男")
# room = Room()
# room.add_member(charactor1)
# room.add_member(charactor2)
#
# if len(room.member_list) == 2:
# 	print("房间人数已满,开始战斗")
#
# while True:
#     print("------------------【round%d】-----------------"%count)
#     # room.add_member(charactor1)
#     # room.add_member(charactor2)
#     if len(room.member_list) == 2:
#         if charactor1.blood > 0:
#             charactor1.attack_role2(charactor2)
#             if charactor2.blood <= 0:
#                 print("谷帅获胜")
#                 break
#         if charactor2.blood > 0:
#             charactor2.attack_role1(charactor1)
#             if charactor1.blood <= 0:
#                 print("金之扬获胜")
#                 break
#     count += 1
#     time.sleep(1)
#     print('\n')